{{Extend "layout"}}
{{Block "title"}}{{"管理中心首页"|$.T}}{{/Block}}
{{Block "main"}}
<div class="row stat-card-items">
    {{- $cardSize := len $.Stored.cards -}}
    {{- range $k,$card := $.Stored.cards -}}
    {{- if not ($.IsHidden $card) -}}
    <div class="{{if lt $cardSize 4}}col-md-4{{else}}col-md-3{{end}} stat-card-item">
        <div class="block-flat">
            <div class="content no-padding label-radius">
                <div class="overflow-hidden nowrap">
                    <i class="fa {{$card.IconName}} fa-4x pull-left color-{{$card.IconColor}} sm-margin-right"></i>
                    <h3 class="no-margin">{{$card.Short}}</h3>
                    <p class="color-primary">{{$card.Name|$.T|UpperCaseFirst}}</p>
                </div>
                <h1 class="no-margin overflow-hidden">{{$card.Content}}</h1>
            </div>
        </div>
    </div>
    {{- end -}}
    {{- end -}}
</div>
{{- range $k,$block := $.Stored.blocks -}}
{{- if not ($.IsHidden $block) -}}
{{- if $block.Tmpl}}{{$.Fetch $block.Tmpl $}}{{end -}}
{{- end -}}
{{- end -}}
<div class="row no-margin-top">
    <div class="col-md-12">
        <div class="block-flat no-padding">
            <div class="header">
                <h3>{{"欢迎回来"|$.T}}</h3>
            </div>
            <div class="content padding">
                <div class="well no-margin no-padding sm-padding-top">
					<ul class="wrap"><li>{{"欢迎使用"|$.T}} {{Version}}</li><li>BUILD: {{BuildTime}}</li><li>COMMIT: {{CommitID}}</li><li>{{"现在是"|$.T}} {{Now.Format "2006-01-02 15:04"}} {{Now.Weekday}}</li></ul>
                </div>
            {{- if $.Stored.license.Key -}}
            <div class="alert alert-success alert-white rounded license-info-container{{if $.Stored.license.Info.LicenseID}} license-items-1{{end}}">
                <div class="icon"><span class="text-white">{{"授权信息"|$.T}}</span></div>
                <div class="row">
                <dl class="col-md-3"><dt>{{"授权用户"|$.T}}</dt><dd>{{$.Stored.license.Info.Name}}</dd></dl>
                <dl class="col-md-3"><dt>{{"证书编号"|$.T}}</dt><dd>{{$.Stored.license.Info.LicenseID}}</dd></dl>
                {{- if $.Stored.license.Info.Domain -}}
                <dl class="col-md-3"><dt>{{"授权域名"|$.T}}</dt><dd>{{$.Stored.license.Info.Domain}}</dd></dl>
                {{- else -}}
                <dl class="col-md-3"><dt>{{"机器编号"|$.T}}</dt><dd>{{$.Stored.license.Info.MachineID}}</dd></dl>
                {{- end -}}
                {{- if $.Stored.license.Info.Expiration.IsZero -}}
                <dl class="col-md-3"><dt>{{"过期时间"|$.T}}</dt><dd>{{"永久有效"|$.T}}</dd></dl>
                {{- else -}}
                    {{- $remaining := $.Stored.license.Info.Remaining $.Lang.String -}}
                    {{- $showExpirationTime := $.Stored.showExpirationTime -}}
                    {{- if and (ge $showExpirationTime 0) (or (eq $showExpirationTime 0) (lt $remaining.Duration.Seconds (Float64 $showExpirationTime))) -}}
                    <dl class="col-md-3"><dt>{{"过期时间"|$.T}}</dt><dd>
                        {{- $.Stored.license.Info.Expiration.Format "2006-01-02" -}}
                        {{- $remainingString := $remaining.String -}}
                        &nbsp;
                        {{- if HasPrefix $remainingString "-" -}}
                            (<span class="color-danger">{{"已过期"|$.T}} {{TrimPrefix $remainingString "-"}}</span>)
                        {{- else -}}
                            (<span class="color-success">{{"还剩"|$.T}} {{$remainingString}}</span>)
                        {{- end -}}
                        <a class="btn btn-xs btn-default" href="{{$.Stored.productURL}}" target="_blank"><i class="fa fa-shopping-cart"></i>{{"续期"|$.T}}</a>
                    </dd></dl>
                    {{- end -}}
                {{- end -}}
                </div><!-- /.row -->
             </div><!-- /.alert -->
             {{- end -}}
            </div><!-- /.content -->
        </div>
    </div>
</div>
{{/Block}}
{{Block "footer"}}
{{- range $k,$block := $.Stored.blocks -}}
{{- if not ($.IsHidden $block) -}}
{{- if $block.Footer}}{{$.Fetch $block.Footer $}}{{end -}}
{{- end -}}
{{- end -}}
{{/Block}}